@echo off
chcp 65001

:: Use PowerShell to get the current time and format it as a version number
powershell -Command "$now = Get-Date; $version = $now.ToString('yy.MMdd.HHmmss'); Set-Content -Path 'version' -Value $version -NoNewline; Write-Host ('Version updated to: ' + $version)"

:: Update the version number in build.bat
powershell -Command "$version = Get-Content 'version'; (Get-Content 'build.bat') -replace 'set VERSION=.*', ('set VERSION=' + $version) | Set-Content 'build.bat'"

echo Done!